/**
*  \file    distmem_cfg.h
*
*  \brief   Configuration header of the distributed memory module.
*
*  \author  Michael J. Hohmann <michael.hohmann@linde-mh.de>
*
*/

#ifndef DISTMEM_CFG_H_INCLUDED
#define DISTMEM_CFG_H_INCLUDED

/*================================================[ public includes  ]================================================*/
#include "ipcv.h"
#include "distmem_common_data.h"
#include "memory_reserved.h"


/*================================================[ public defines   ]================================================*/

#define DISTMEM_RX_BUFFER        ( &MEMORY_RESERVED_INTER_RS232_RX_BUFFER )
#define DISTMEM_TX_BUFFER        ( &MEMORY_RESERVED_INTER_RS232_TX_BUFFER )

/** Abbreviation to access the data of the 2nd microcontroller. */
#define UC2 distmem_rx

#define DISTMEM_APP_READY        (EQU_IPCV_APP_all_tasks == distmem_get_app_valid_state())

/*================================================[ public datatypes ]================================================*/

/** Data to be transmitted. */
typedef struct distmem_common_data_main distmem_tx_data_t;

/** Data to be received. */
typedef struct distmem_common_data_supervisor distmem_rx_data_t;


/*================================================[ public variables ]================================================*/

/*================================================[ public functions ]================================================*/

/**
*  Precopy function.
*
*  This macro is an interface to copy the data into the tx bufer,
*  each time before they have been transmitted.
*/
#define distmem_precopy_function()   application_precopy_function()


/*====================================================================================================================*/

#endif

/***********************************************************************************************************************
*                             Copyright 2011 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/
